from flask import Flask
# from flask_cors import CORS
import os


def create_app(config_name):
    """ Create an application instance """
    application = Flask(__name__)
    app = application
    # import configration
    cfg = os.path.join(os.getcwd(), 'config', config_name + '.py')
    # To get cfg : app.config['key']
    app.config.from_pyfile(cfg)
    # CORS(app, supports_credentials=True)
    #app.cache = MemcachedCache(['memcached:11211'])

    return app
